/*============================================================================*/
/*  Copyright (C) 2009-2011, iSOFT INFRASTRUCTURE SOFTWARE CO.,LTD.
 *  
 *  All rights reserved. This software is iSOFT property. Duplication 
 *  or disclosure without iSOFT written authorization is prohibited.
 *  
 *  
 *  @file       <Xcp.h>
 *  @brief      <Xcp Module main H file. This version is compitable with CANape.>
 *  
 *  <Compiler: Codewarrior for mpc55xx v2.6     MCU:MPC56XX>
 *  
 *  @author     <Dongyuan.Sun, qitao.Yu>
 *  @date       <2013-03-06>
 */
/*============================================================================*/
#ifndef  XCP_H
#define  XCP_H

/*=======[R E V I S I O N   H I S T O R Y]====================================*/
/*  <VERSION>    <DATE>    <AUTHOR>     <REVISION LOG>
 *  V1.0.0       20081127  Dongyuan.Sun Initial version
 * 
 */
/*============================================================================*/

/*=======[V E R S I O N  I N F O R M A T I O N]===============================*/
#define XCP_H_VENDOR_ID  0
#define XCP_MODULE_ID  (212)
#define XCP_H_AR_MAJOR_VERSION  4
#define XCP_H_AR_MINOR_VERSION  0
#define XCP_H_AR_PATCH_VERSION  3
#define XCP_H_SW_MAJOR_VERSION  1
#define XCP_H_SW_MINOR_VERSION  0
#define XCP_H_SW_PATCH_VERSION  0
#define XCP_H_VENDOR_API_INFIX  0

/*=======[I N C L U D E S]====================================================*/
#include "Xcp_Cfg.h"
#include "Xcp_Interface.h"

#if (XCP_ON_CAN_ENABLE == STD_ON) 
#include "XcpOnCan_Cbk.h"
#endif
#if ((XCP_ON_ETHERNET_ENABLE == STD_ON)||(XCP_ON_CCD_ENABLE == STD_ON))
#include "XcpOnEth_Cbk.h"
#endif
#if (XCP_ON_FLEXRAY_ENABLE == STD_ON)
#include "XcpOnFr_Cbk.h"
#endif

/*=======[M A C R O S]========================================================*/

/* Service id's for xcp functions */
#define XCP_INIT_ID                     0x00
#define XCP_GETVERSIONINFO_ID           0x01
#define XCP_TXCONFIRMATION_ID           0x02
#define XCP_RXINDICATION_ID             0x03
#define XCP_MAINFUNCTION_ID             0x04
#define XCP_SETTRANSMISSION_ID          0x05
#define XCP_TRIGGERTRANSMIT_ID          0x41

/* Development errors */
#define XCP_E_INV_POINTER               0x01
#define XCP_E_NOT_INITIALIZED           0x02
#define XCP_E_INVALID_PDUID             0x03
#define XCP_E_NULL_POINTER              0x12

#define XCP_PROTOCOL_VERSIOM_MAJOR              1
#define XCP_PROTOCOL_VERSIOM_MINOR              1
#define XCP_CAN_TRANSPORT_LAYER_VERION_MAJOR    1
#define XCP_CAN_TRANSPORT_LAYER_VERION_MINOR    1


/*=======[T Y P E   D E F I N I T I O N S]====================================*/
/* Transmission Mode for Xcp_SetTransmissionMode en/disable the XCP Tx Capability */
typedef enum
{
    XCP_TX_OFF,                     /*disable the transmission capability*/
    XCP_TX_ON                       /*enble the transmission capability*/
}Xcp_TransmissionModeType;

/*=======[E X T E R N A L   F U N C T I O N   D E C L A R A T I O N S]========*/
extern FUNC(void,XCP_CODE) Xcp_Init(CONSTP2CONST(Xcp_ConfigType, 
                            AUTOMATIC, XCP_CONST)Xcp_ConfigPtr);

extern FUNC(void,XCP_CODE) Xcp_MainFunction(void);

#if (XCP_VERSION_INFO_API == STD_ON)
extern FUNC(void, XCP_CODE) Xcp_GetVersionInfo(P2VAR(Std_VersionInfoType, 
                                          AUTOMATIC,XCP_VAR)versioninfo);
#endif

#if (XCP_SUPPRESS_TX_SUPPORTED == STD_ON)
extern FUNC(void, XCP_CODE) Xcp_SetTransmissionMode(NetworkHandleType Channel, 
                                               Xcp_TransmissionModeType Mode);
#endif

#if (XCP_PL_DAQ == (XCP_PL_DAQ & XCP_RESOURCE))
extern FUNC(void, XCP_CODE) Xcp_EventIndication(uint16 eventNum);
#endif

#endif  /* endof XCP_H */

/*=======[E N D   O F   F I L E]==============================================*/

